package com.revenco.bi.dao.nutz;

import java.util.List;

import org.nutz.dao.Cnd;
import org.nutz.dao.Condition;
import org.springframework.stereotype.Repository;

import com.revenco.bi.dao.TnDataDrillRelaDao;
import com.revenco.bi.model.TnDataDrillRela;

@Repository
public class TnDataDrillRelaDaoImpl extends AstractDaoImpl implements TnDataDrillRelaDao{
	public List<TnDataDrillRela> getDrillValueById(String columnId){
		Condition condition = Cnd.where("COLUMN_ID", "=", columnId);
		return this.getDao().query(TnDataDrillRela.class, condition);
	}
	
	public TnDataDrillRela getDataDrillRela(String columnId, String drillPath) {
		Condition condition = Cnd.where("COLUMN_ID", "=", columnId).and(
				"DRILL_PATH", "=", drillPath);
		List<TnDataDrillRela> list = this.getDao().query(TnDataDrillRela.class,
				condition);
		if (list.size() > 0) {
			return list.get(0);
		} else {
			return null;
		}
	}
}
